<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <title>华南农业大学故障报修后台</title>
    <link rel="stylesheet" href="/static/login/css/style.css"/>
    <!-- 提示升级高级浏览器操作 -->
    <style>
        .ie-content{  position: fixed; left: 0; top: 0; right: 0; bottom:0; background:#fff; z-index: 1000;}
        .ie-content-bj{ width: 1000px; height: 380px; position: fixed; left: 50%; top: 36%; margin:-190px 0 0 -500px; background:url(img/sj.jpg) no-repeat; }
        .ie-list{ padding:168px 0 0 371px; }
        .ie-list a{ margin-right: 80px; }
        .login_main_errortip {
            width: 90%;
            padding-left: 38px;
            color: red;
            font-size: 12px;
        }
    </style>
</head>
<body class="body_bj">

<div class="login">
    <div class="logo">
        <img src="/static/login/img/logo.png" >
    </div>
    <form id="loginForm" method="post" action="/pc/login.html">
        <input type="hidden" name="loginPath" value="${loginPath}"> <!--th:value="${loginPath}"-->
        <ul class="login-list">
            <li><input type="text" name="account" required placeholder="账号"></li>
            <li><input type="password" name="password" required placeholder="密码"></li>
            <li><input type="text" name="code" required placeholder="请输入验证码">
                <span class="yzm2">
                    <img id="img_code" src="/pc/code.html" onclick="return changeCode();">
                </span>
            </li>
            <li><button class="btn" onclick="submitForm()" >登录</button></li>
        </ul>
        <div style="margin-top:10px">
            <div class="login_main_errortip" >${message!}</div><!--th:text="${message!}"-->
        </div>
    </form>
</div>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script type="text/javascript">
    function submitForm() {
        $('#loginForm').submit();
    }
    function changeCode() {
        var img = $("#img_code");
        var url = img.attr("src");
        var index = url.indexOf("?");
        if (index > 0) {
            url = url.substring(0, index);
        }
        url += "?time=" + Date.now();
        img.attr("src", url);
        return false;
    }
    function IdleMonitor(timeout, callback) {
        this.id = setTimeout(callback, timeout);

        this.activate = function () {
            // console.log('move');
            clearTimeout(this.id);
            this.id = setTimeout(function () {
                callback();
                this.activate();
            }.bind(this), timeout);
        };

        window.addEventListener('mousemove', function () {
            this.activate();
        }.bind(this));
    }

    // 30分钟
    new IdleMonitor(30*60*1000, function () {
        location.reload();
    });
</script>
</body>
</html>